//package com.cn.hadoop.TQ;
//
//import org.apache.hadoop.conf.Configuration;
//import org.apache.hadoop.fs.Path;
//import org.apache.hadoop.io.IntWritable;
//import org.apache.hadoop.mapreduce.Job;
//import org.apache.hadoop.mapreduce.lib.input.FileInputFormat;
//import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;
//
//import java.io.IOException;
//
//public class MYTQ {
//    public static void main(String[] args) throws IOException, ClassNotFoundException, InterruptedException {
//        Configuration conf = new Configuration(true);
//        conf.addResource("hdfs-site.xml");
//        conf.addResource("core-site.xml");
//        conf.addResource("yarn-site.xml");
//        conf.addResource("mapred-site.xml");
//        conf.set("mapreduce.app-submission.cross-platform", "true");
////        conf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem");
//        Job job = Job.getInstance(conf);
//        job.setJarByClass(MYTQ.class);
//        //用来对元数据处理成想要的数据  mapper
//        job.setMapperClass(TMapper.class);
//        job.setMapOutputValueClass(IntWritable.class);
//        job.setMapOutputKeyClass(TQ.class);
//        job.setSortComparatorClass(TComparator.class);
//        job.setPartitionerClass(TPartitioner.class);
//        job.setJobName("天气");
//
//        job.setGroupingComparatorClass(TGroupingComparator.class);
//        job.setReducerClass(TReduce.class);
//
//        Path path = new Path("hdfs://mycluster/user/tq.txt");
//        Path out = new Path("hdfs://mycluster/user/hadoop/tq");
//        FileInputFormat.addInputPath(job, path);
//        if (out.getFileSystem(conf).exists(out)) {
//            out.getFileSystem(conf).delete(out, true);
//        }
//        FileOutputFormat.setOutputPath(job, out);
//        job.waitForCompletion(true);
//    }
//}
